package com.bsoft.gol.editor.controller;

import hcn.util.BaseResponse;
import com.bsoft.gol.editor.editor.EditorQuestionnaireOfficial;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bsoft.gol.editor.service.EditorQuestionnaireOfficialApi;

import java.util.List;

/**
 * @program: Myproject
 * @description:
 * @author: zangsf
 * @create: 2022-12-08 15:36
 **/
@Controller
@RequestMapping(value = "/api/auth/editorQuestionnaireOfficial")
public class EditorQuestionnaireOfficialController {

    @Autowired
    private EditorQuestionnaireOfficialApi editorQuestionnaireOfficialApi;


    /* *
     * @description :查询文案列表
     * @author      :zangsf
     * @date        :2022-12-08 15:38
     * @param       :[questionnaireId]
     * @return      :java.util.List<com.bsoft.gol.editor.editor.EditorQuestionnaireOfficial>
     */
    @RequestMapping("/list")
    @ResponseBody
    BaseResponse<List<EditorQuestionnaireOfficial>> queryEditorQuestionnaireOfficialList(@RequestBody EditorQuestionnaireOfficial qo){
        return editorQuestionnaireOfficialApi.queryEditorQuestionnaireOfficialList(qo);
    }

    /* *
     * @description :删除这个问卷的所有文案
     * @author      :zangsf
     * @date        :2022-12-08 15:46
     * @param       :[qo]
     * @return      :com.bsoft.gol.editor.editor.BaseResponse
     */
    @RequestMapping("/remove")
    @ResponseBody
    BaseResponse removeEditorQuestionnaireOfficial(@RequestBody EditorQuestionnaireOfficial qo){
        return editorQuestionnaireOfficialApi.removeEditorQuestionnaireOfficial(qo);
    }

    /* *
     * @description :给表单添加文案
     * @author      :zangsf
     * @date        :2022-12-08 15:47
     * @param       :[qos]
     * @return      :com.bsoft.gol.editor.editor.BaseResponse
     */
    @RequestMapping("/addUpdate")
    @ResponseBody
    BaseResponse addEditorQuestionnaireOfficial(@RequestBody EditorQuestionnaireOfficial qo){
        return editorQuestionnaireOfficialApi.addEditorQuestionnaireOfficial(qo);
    }
}
